import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    redirect: "/login",
  },
  {
    path: "/login",
    component: () => import("../views/Login.vue"),
  },
  {
    path: "/nav",
    name: "nav",
    component: () => import("../views/Nav.vue"),
  },
  {
    path: "/container",
    name: "container",
    component: () => import("../views/Container.vue"),
  },
  {
    path: "/component",
    name: "component",
    component: () => import("../views/Component.vue"),
    children: [
      {
        path: "container",
        component: () => import("../views/Container.vue"),
      },
      {
        path: "table",
        component: () => import("../views/Table.vue"),
      },
      {
        path: "form",
        component: () => import("../views/Form.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
